package aad.storyboard.view;

import java.util.ArrayList;

import aad.storyboard.model.Script;
import aad.storyboard.model.Story;
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.util.AttributeSet;
import android.webkit.WebSettings;
import android.webkit.WebView;

/**
 * View that is shown when an InfoAnimation is triggered. Will display the html data provided either by setting Image.setInfo() or by supplying an html file in the asset folder 
 */
public class WikiView extends WebView{
	
	private JavaScriptInterface jInterFace;
	

	public WikiView(Context context, AttributeSet attrs) {	
		super(context, attrs);		
		WebSettings webSettings = getSettings();
	    webSettings.setJavaScriptEnabled(true);
		
	}
	
	public WikiView(Context context) {
		super(context);	
		
		WebSettings webSettings = getSettings();
	    webSettings.setJavaScriptEnabled(true);
	    
        
	}	
	
	public void setjInterFace(Activity a) {
		this.jInterFace = new JavaScriptInterface(a, this);
		addJavascriptInterface(jInterFace, "Android");
	}

	public JavaScriptInterface getjInterFace() {
		return jInterFace;
	}

	public void setjInterFace() {		
		addJavascriptInterface(jInterFace, "Android");
		System.out.println("Javascript set"+jInterFace.toString());
	}
	
}
